/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package homomorphism.list;

import utility.PairT;
import utility.LongPair;
import java.io.IOException;
import java.util.ArrayList;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;

/**
 *
 * @author takeshi
 */
public abstract class SecondMapper<InVal> extends MapReduceBase implements Mapper<LongPair, InVal, LongPair, InVal> {

    private static final Log LOG = LogFactory.getLog(SecondMapper.class);

    public void map(LongPair key, InVal value, OutputCollector<LongPair, InVal> output, Reporter reporter) throws IOException {

        LongPair newKey = new LongPair(0, key.getSecond());// key(pid,index)
        output.collect(newKey, value);
    }
}
